package MapHomeWork.secondquestion;

import java.util.Arrays;
import java.util.Iterator;
import java.util.LinkedList;

public class LinkedListHomeWork {
    public static void main(String[] args) {
        String[] strs={"12345","67891","12347809933","98765432102","67891","12347809933"};
        LinkedList<String> linkedList=new LinkedList<>();
        for (String s: strs) {
            if(!linkedList.contains(s)){
                linkedList.add(s);
            }
        }
        //linkedList.addAll(Arrays.asList(strs));

        Iterator<String> it=linkedList.listIterator();
        while (it.hasNext()){
            String str=it.next();
            System.out.println(str);
        }

        System.out.println("************************");

        for (String string:linkedList) {
            System.out.println(string);
        }
    }
}
